package demo1;

import java.util.Stack;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2024-03-08
 * Time: 8:10
 */
public class Test1 {
    public static void main(String[] args) {
        MyStack myStack = new MyStack();
        myStack.push(1);
        myStack.push(2);
        myStack.push(3);
        System.out.println(myStack);
        System.out.println("======");

        System.out.println(myStack.pop());
    }
    public static void main1(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(12);
        stack.push(23);
        stack.push(34);
        //删除栈顶元素
        int x1 =stack.pop();
        System.out.println(x1);
        //获取栈顶元素
        int x2 = stack.peek();
        System.out.println(x2);

    }

}
